<#include "/common/header.html" />
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInUp">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox">
                    <div class="ibox-title">
                        <h5>用户列表</h5>
                        <div class="ibox-tools">
                            <a href="toadd" class="btn btn-primary btn-xs">添加用户</a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row m-b-sm m-t-sm">
                            <form action="list" method="get" id="seachForm">
                            <div class="col-md-4">
                                    <input type="text" value="${userName}" name="userName" placeholder="请输入用户名" class="input-sm form-control">
                            </div>
                            <div class="col-md-2">
                            	<select name="userRole" class="input-sm form-control">
                            		<option value="0">请选择</option>
                            		<#list roleList as role>
                            		<option value="${role.id}" 
                            		${(role.id == userRole)?string('selected="selected"','')}
                            		>${role.roleName}</option>
                            		</#list>
                            	</select>
                            </div>
                            <div class="col-md-2">
                                <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
                            </div>
                             </form>
                        </div>
                         <table class="table table-hover">
                          	<#list pageInfo.records as user>
                          		<tr>
                          			<td>${user.userCode}</td>
                          			<td>${user.userName}</td>
                          			<td>${(user.gender==1)?string('男','女')}</td>
                          			<td>${user.birthday}</td>
                          			<td>${user.phone}</td>
                          			<td>${user.roleName}</td>
                          			<td>
                          				<a href="" class="btn btn-success">编辑</a>
                          				<a href="del?id=${user.id}&pageno=${pageInfo.current}" class="btn btn-danger">删除</a>
                          			</td>
                          		</tr>
                          	</#list>   
                          </table>
                          <div class="btn-group text-center">
                               	<#if pageInfo.hasPrevious()>
                               	<a onclick="rollPage(1)" class="btn btn-white">首页</a>
                                <a onclick="rollPage(${pageInfo.current - 1})" class="btn btn-white"><i class="fa fa-chevron-left"></i> 上一页</a>
                                </#if>
                                <#if pageInfo.hasNext() >
	                                <a onclick="rollPage(${pageInfo.current + 1})" class="btn btn-white">下一页 <i class="fa fa-chevron-right"></i></a>
	                                <a onclick="rollPage(${pageInfo.pageCounts})" class="btn btn-white">末页</a>
	                            </#if>
	                            <span>[${pageInfo.current}/${pageInfo.pageCounts}]</span>
                              </div>
                         </div>
                    </div>
                </div>
            </div>
        </div>
  <#include "/common/footer.html" />  
</body>
</html>